import React from 'react'
import { useSelector } from 'react-redux'
import { View } from '@tarojs/components'
import { SpImage } from '@/components'
import { classNames } from '@/utils'

import './index.scss'

function SpGoodsItemSeckill(props) {
  const { favs = [] } = useSelector((state) => state.user)
  const { info = null, renderFooter = null, mode = 'widthFix' } = props

  if (!info) {
    return null
  }

  return (
    <View className={classNames('sp-goods-item')}>
      <View className='goods-item__hd' >
        <SpImage lazyLoad src={info.pic} mode={mode}  width='100%' height='100%' />
      </View>

      <View className='goods-item__ft ft'>{renderFooter}</View>
    </View>
  )
}

SpGoodsItemSeckill.options = {
  addGlobalClass: true
}

export default SpGoodsItemSeckill
